You can use the GetSysBeepVolume and SetSysBeepVolume functions to get and set the volume level of the system alert sound. You can use GetDefaultOutputVolume and SetDefaultOutputVolume to get and set the default output volume for a particular output device.
These four functions are available only in Sound Manager version 3.0 and later.
With all of these functions, you specify a volume with a 16-bit value, where 0 represents no volume (that is, silence) and 256 (hexadecimal $0100) represents full volume. The right and left volumes of a stereo sound are encoded as the high word and the low word, respectively, of a 32-bit value. Moreover, it's possible to overdrive a particular volume level if you need to amplify a low signal. For example, the long word $02000200 specifies a volume level of twice full volume on both the left and right channels of a stereo sound.
In addition to the four functions described in this section, Sound Manager version 3.0 introduces two new sound commands, getVolumeCmd and volumeCmd , that you can use to get and set the volume of a particular sound channel. See [link] for details on these two sound commands; see "Managing Sound Volumes" for a code listing that uses the volumeCmd command.
You can use the GetSysBeepVolume function to determine the current volume of the system alert sound.
FUNCTION GetSysBeepVolume (VAR level: LongInt): OSErr;
The GetSysBeepVolume function returns, in the level parameter, the current volume level of the system alert sound. The values returned in the high and low words of the level parameter range from 0 (silence) to $0100 (full volume).
The GetSysBeepVolume function is available only in versions 3.0 and later of the Sound Manager. You can call this function at interrupt time.
You can use the SetSysBeepVolume function to set the current volume of the system alert sound.
FUNCTION SetSysBeepVolume (level: LongInt): OSErr;
The SetSysBeepVolume function sets the current volume level of the system alert sound. The values you can specify in the high and low words of the level parameter range from 0 (silence) to $0100 (full volume). Any calls to the SysBeep procedure use the volume set by the most recent call to SetSysBeepVolume .
The SetSysBeepVolume function is available only in versions 3.0 and later of the Sound Manager. You can call this function at interrupt time.
You can use the GetDefaultOutputVolume function to determine the default volume of a sound output device.
FUNCTION GetDefaultOutputVolume (VAR level: LongInt): OSErr;
The GetDefaultOutputVolume function returns, in the level parameter, the default volume of a sound output device. The values returned in the high and low words of the level parameter range from 0 (silence) to $0100 (full volume).
The GetDefaultOutputVolume function is available only in versions 3.0 and later of the Sound Manager. You can call this function at interrupt time.
You can use the SetDefaultOutputVolume function to set the default volume of a sound output device.
FUNCTION SetDefaultOutputVolume (level: LongInt): OSErr;
The SetDefaultOutputVolume function sets the default volume of a sound output device. The values you can specify in the high and low words of the level parameter range from 0 (silence) to $0100 (full volume).
The SetDefaultOutputVolume function is available only in versions 3.0 and later of the Sound Manager. You can call this function at interrupt time.
| Previous | Chapter contents | Chapter top | Section top | Next |